package org.nepu.scr.indexrate.converter.riskrate.equipmentrisk;

import cn.hutool.json.JSONUtil;
import org.nepu.scr.indexrate.vo.riskrate.equipmentrisk.RemoteB228;

import javax.persistence.AttributeConverter;
import javax.persistence.Convert;

@Convert
public class RemoteB228Converter implements AttributeConverter<RemoteB228, String> {
    @Override
    public String convertToDatabaseColumn(RemoteB228 remoteB228) {
        return JSONUtil.toJsonStr(remoteB228);
    }

    @Override
    public RemoteB228 convertToEntityAttribute(String s) {
        return JSONUtil.toBean(s, RemoteB228.class);
    }
}
